package com.kitwee.serialport.data.model;

public enum Databits {

    Seven(7),

    Eight(8);

    private final int value;

    Databits(int value) {
        this.value = value;
    }

    public static Databits fromValue(int value) {
        switch (value) {
            case 7:
                return Seven;
            case 8:
                return Eight;
            default:
                throw new IllegalArgumentException("Invalid value!");
        }
    }

    public int value() {
        return value;
    }


}
